package com.zzjson.autoconfigure.third;

import com.zzjson.autoconfigure.Person;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.StringUtils;

/**
 * <p>****************************************************************************</p>
 * <p><b>Copyright © 2010-2020 shuncom team All Rights Reserved<b></p>
 * <ul style="margin:15px;">
 * <li>Description : com.zzjson.autoconfigure.second</li>
 * <li>Version     : 1.0.0</li>
 * <li>Creation    : 2020年03月18日</li>
 * <li>@author     : zzy0_0</li>
 * </ul>
 * <p>****************************************************************************</p>
 */
public class PersonImportBeanDefinitionRegistrar implements ImportBeanDefinitionRegistrar {


	@Override
	public void registerBeanDefinitions(AnnotationMetadata importingClassMetadata, BeanDefinitionRegistry registry) {
		Class<Person> beanClass = Person.class;
		RootBeanDefinition beanDefinition = new RootBeanDefinition(beanClass);
		String beanName = StringUtils.uncapitalize(beanClass.getSimpleName());
		registry.registerBeanDefinition(beanName, beanDefinition);
	}
}
